﻿@model IEnumerable<DistanceLearning.Models.SchoolDetails>

<table>
    <tr>
        <th>ID школы</th>
        <th>Название</th>
        <th>Описание</th>
        <th>Наличие базы</th>
        <th></th>
    </tr>

@foreach (var school in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => school.SchoolId)
        </td>
        <td>
            @Html.DisplayFor(modelItem => school.SchoolName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => school.Details)
        </td>
        <td>
            @Html.DisplayFor(modelItem => school.HaveDatabase)
        </td>
        <td>
            @Html.ActionLink("Редактировать", "EditSchool", new {  id=school.SchoolId }) |
            @Html.ActionLink("Удалить", "DeleteSchool", new { id=school.SchoolId }) |
            @if (!school.HaveDatabase) {
                @Html.ActionLink("Создать базу", "CreateSchoolDatabase", new {id = school.SchoolId})
            }
        </td>
    </tr>
}

</table>
